import  copy

class MobilePhone:
    def __init__(self,cpu):
        self.cpu = cpu

class CPU:
    pass

c = CPU()
m = MobilePhone(c)

print("浅拷贝。。。")
m2 = copy.copy(m)       #m2是新拷贝的一个手机对象
print(id(m))
print(id(m2))
print(id(m.cpu))
print(id(m2.cpu))       #m2和m拥有了一样的cpu对象
print("深拷贝。。。")
m3 = copy.deepcopy(m)
print(id(m))
print(id(m3))
print(id(m.cpu))
print(id(m3.cpu))         #m3和m拥有不一样的cpu对象